<?php use Backend\Controller\Plugin\AuthorizationPlugin; ?>
<div ng-app="utilisateurModule">
	<div class="table-responsive" ng-controller="UtilisateurController">
		<table class="table table-bordered table-hover table-striped tablesorter">
	    	<thead>
	        	<tr>
					<th class="col-sm-2">Nom <i class="fa fa-sort"></i></th>
					<th class="col-sm-2">Pr&#233;nom <i class="fa fa-sort"></i></th>
					<th class="col-sm-5">Agence <i class="fa fa-sort"></i></th>
					<th class="col-sm-2">Date de cr&#233;ation <i class="fa fa-sort"></i></th>
					<th class="col-sm-1">&nbsp;</th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="utilisateur in utilisateurs">
					<td>{{utilisateur.nom}}</td>
					<td>{{utilisateur.prenom}}</td>
					<td>{{utilisateur.agenceLibelle}}</td>
					<td>{{utilisateur.dateCreation}}</td>
					<td>
						<div class="btn-group btn-actions-bo">
							<button type="button" class="btn btn-primary">Actions</button>
						  	<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
						    	<span class="caret"></span>
						    	<span class="sr-only">Toggle Dropdown</span>
						  	</button>
						  	<ul class="dropdown-menu" role="menu">
						  		<?php if( AuthorizationPlugin::isAllowed2($this->layout()->loadIdentity, "Utilisateur", "edit") ) { ?>
						    			<li><a href="/utilisateur/edition?id={{utilisateur.id}}">Editer</a></li>
						    	<?php } ?>
						    	
						  		<?php if( AuthorizationPlugin::isAllowed2($this->layout()->loadIdentity, "Utilisateur", "delete") ) { ?>
						    			<li><a href="#" ng-click="deleteUtilisateur(utilisateur)">Supprimer</a></li>
						    	<?php } ?>
						  	</ul>
						</div>
					</td>
				</tr>
			</tbody>
		</table>
		<ng-modal ng-model="modal" bouton-valider="ValiderSuppressionUtilisateur()" />
	</div>
</div>	



